<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js"></script>
</head>
<body>
	<h2>Hello Wordl</h2>
	<input value="postJson" type="button" onclick="postJson()" />


	<script type="text/javascript">
	    function postJson() {
	        var data = {
	            no : $('#no').val(),
	            quantity : $('#quantity').val(),
	            date : $('#date').val()
	        };
	        $.ajax({
	            type : 'POST',
	            contentType : 'application/json',
	            url : '/insertOne',
	            data : JSON.stringify(data),
	            success : function(r) {
	                console.log(r);
	            },
	            error : function() {
	                alert('error!')
	            }
	        });
	    }
	</script>
</body>
</html>